<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:composition template="/template/DefaultTemplate.xhtml">
        <ui:define name="content">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form rendered="#{loginBacking.editAccount}">
                <p:panel header="Personal Details">
                <h:panelGrid columns="2">
                    <h:outputText value="User Account ID:"/>
                    <h:outputText value="#{contactEntityController.selected.person}" title="#{bundle.ViewContactEntityTitle_person}"/>
                       
                    <h:outputText value="Username: "/>
                    <h:outputText value="#{contactEntityController.selected.person.name}" />  
                    
                    <h:outputText value="Title: "/>
                    <h:outputText value="#{contactEntityController.selected.person.title}" />
                    
                    <h:outputText value="First Name: "/>
                    <h:outputText value="#{contactEntityController.selected.person.firstName}" />
                    
                    <h:outputText value="Last Name: "/>
                    <h:outputText value="#{contactEntityController.selected.person.lastName}" />                                    
                    
                </h:panelGrid>
                </p:panel>
                <br />
                
                <p:panel header="Contact Information">
                <h:panelGrid columns="2">                                  
                    
                    <h:outputText value="#{bundle.ViewContactEntityLabel_email}"/>
                    <h:outputText value="#{contactEntityController.selected.email}" />                  
                    
                    <h:outputText value="#{bundle.ViewContactEntityLabel_contactNumber}"/>
                    <h:inputText value="#{contactEntityController.selected.contactNumber}" title="#{bundle.ViewContactEntityTitle_contactNumber}"/>
                    
                </h:panelGrid>
                </p:panel>
                <br />
                
                <ui:include src="/entities/addressEntity/EditAddress.xhtml"/>
                <br />
                
                <p:panel header="User Settings" rendered="#{contactEntityController.indeedSystemUser}">
                <h:panelGrid columns="2">                                     
                    
                    <h:outputText value="Forward Internal Messages to Email: "/>
                    <h:selectBooleanCheckbox value="#{contactEntityController.systemUser.setting.forwardToEmail}" />                  
                    
                </h:panelGrid>
                </p:panel>
                <br />
                
                <h:commandLink action="#{contactEntityController.update}" value="Save"/>
                
            </h:form>
        </ui:define>
    </ui:composition>

</html>
